package com.lwq.feign;

import com.lwq.fallback.ProductFallbackFeign;
import com.lwq.util.Result;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author lwq
 */
@Qualifier("productFeign")
@FeignClient(value = "alibaba-product", fallback = ProductFallbackFeign.class)
public interface ProductFeign {

    /**
     * 远程方法：通过主键查询一条商品记录
     *
     * @param id 商品主键
     * @return 对应主键的商品信息
     */
    @GetMapping("/api/v1/product/select-by-id")
    Result selectById(@RequestParam Integer id);



}